#

| Chapter 4 The Bourne Shell and Korn Shell |

## exec

    exec [command]

Execute `command` in place of the current process (instead of creating a new process). exec is also useful for opening, closing, or copying file descriptors.

### Examples

>     trap 'exec 2>&-' 0	Close standard error when
>     	shell script exits (signal 0).
>     $ exec /bin/csh	Replace Bourne shell with C shell.
>     $ exec < infile	Reassign standard input to infile.

Reference: eval |  | Reference: exit